/**
 * 工单模块路由配置
 */

import type { RouteRecordRaw } from 'vue-router'

const workorderRoutes: RouteRecordRaw[] = [
  {
    path: '/workorder',
    name: 'WorkOrder',
    redirect: '/workorder/dashboard',
    meta: {
      title: '工单管理',
      requiresAuth: true,
    },
    children: [
      {
        path: 'dashboard',
        name: 'WorkOrderDashboard',
        component: () => import('@/views/workorder/WorkOrderDashboard.vue'),
        meta: {
          title: '工单仪表盘',
        },
      },
      {
        path: 'workOrder/list',
        name: 'WorkOrderList',
        component: () => import('@/views/workorder/WorkOrderList.vue'),
        meta: {
          title: '工单列表',
        },
      },
      {
        path: 'workOrder/:id',
        name: 'WorkOrderDetail',
        component: () => import('@/views/workorder/WorkOrderDetail.vue'),
        meta: {
          title: '工单详情',
        },
        props: true,
      },
      {
        path: 'assignmentHistory',
        name: 'AssignmentHistory',
        component: () => import('@/views/workorder/AssignmentHistory.vue'),
        meta: {
          title: '分配历史',
        },
      },
      {
        path: 'assignmentHistory/list',
        name: 'AssignmentHistoryList',
        component: () => import('@/views/workorder/AssignmentHistory.vue'),
        meta: {
          title: '历史记录',
        },
      },
      {
        path: 'assignmentHistory/stats',
        name: 'AssignmentHistoryStats',
        component: () => import('@/views/workorder/AssignmentStats.vue'),
        meta: {
          title: '分配统计',
        },
      },
      {
        path: 'assignmentHistory/efficiency',
        name: 'AssignmentHistoryEfficiency',
        component: () => import('@/views/workorder/EfficiencyAnalysis.vue'),
        meta: {
          title: '效率分析',
        },
      },
    ],
  },
]

export default workorderRoutes
